package com.lianxueda.drawing.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lianxueda.drawing.domain.dto.TeacherQueryDTO;
import com.lianxueda.drawing.domain.pojo.Teachers;
import com.lianxueda.drawing.domain.vo.PageVO;
import com.lianxueda.drawing.domain.vo.TeacherVO;
import com.lianxueda.drawing.mapper.TeacherMapper;
import com.lianxueda.drawing.service.TeacherService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teachers> implements TeacherService {
    private final TeacherMapper teacherMapper;

    @Override
    public List<Teachers> findByPage(TeacherQueryDTO teacherQueryDTO) {
        if(teacherQueryDTO.getCurPage()==1){
            teacherQueryDTO.setCurPage(0);
        }
        return teacherMapper.findByPage(teacherQueryDTO);
    }
}
